import requests


def get_order():
    while True:
        try:
            url = 'http://192.168.16.240:8001/api/Inventory/PurchaseOrder/GetPurchaseOrderInfoByUserWorkrecord'
            data = {"userid": "021836126620-236970326", "offset": 0, "count": 50, "status": 0}
            rsp = requests.post(url, json=data)
            if rsp.status_code == 200:
                data = rsp.json()
                # print(data)
                print('获取审批单成功')
                return data['data']['list']
            else:
                print('获取审批单失败')
        except Exception as e:
            print(e)
            continue


# a = get_order()
# print(a)
